home *** CD-ROM | disk | FTP | other *** search
Wrap
OPT PREPROCESS MODULE 'feelin','libraries/feelin','a4', 'intuition/intuition', 'graphics/rastport','graphics/gfxmacros', 'utility/hooks' DEF feelinbase:PTR TO feelinbase PROC main() DEF app,win,myback[16]:STRING,hook:hook DEF grp,o1,o2 sys_SGlob() hook.entry := {hook_draw} hook.data := NIL StringF(myback,'H:%08lx',hook) IF feelinbase := OpenLibrary('feelin.library',FV_VERSION) app := AppObject, FA_Application_Title, 'Demo00', FA_Application_Version, '$VER: Demo00 04.00 (04/01/2003)', FA_Application_Copyright, '©2000 - 2003, Olivier LAVIALE', FA_Application_Author, 'Olivier LAVIALE <HaploLaMain@aol.com>', FA_Application_Description, 'Testing...', FA_Application_Base, 'DEMO00', Child, win := WindowObject, FA_ID, "MAIN", FA_Back, myback, FA_Window_Title, 'Test', FA_ContextHelp, '<align=center><b>Three colored buttons</b></align><hr shine=fill shadow=shadow><align=justify>It is possible for <u>each</u> gadget<br>to have its very own <pens shadow=fill>color scheme</pens>.<br>All you have to do is define<br>the <pens shadow=fill>FA_ColorScheme</pens> attribute.', FA_Window_Open, TRUE, /* -> FA_Window_Borderless, TRUE, -> FA_Window_CloseGadget, FALSE, -> FA_Window_IconifyGadget, FALSE, */ Child, grp := HGroup, FA_Font,'Garnet/16', FA_ColorScheme,',,,c:FFFFFF', Child, o1 := TextObject, ButtonFrame, TextBack, FA_ColorScheme,'c:FF0000,c:C00000,c:000000', FA_Text,'R_ed', InputRelease, FA_ContextHelp,'<font face=garnet size=16 color=#FF0000><pens shadow=halfdark>Red color</pens></font>', End, Child, TextObject, ButtonFrame, TextBack, FA_ColorScheme,'c:0000FF,c:0000C0,c:000000', FA_Text,'B_lue', InputRelease, FA_ContextHelp,'<font face=garnet size=16 color=#0000FF><pens shadow=halfdark>Blue color</pens></font>', End, End, End, End IF app F_DoA(grp,FM_AddMember,[TextObject, ButtonFrame, TextBack, FA_ColorScheme,'c:00FF00,c:00C000,c:000000', FA_Text,'G_reen', InputRelease, FA_ContextHelp,'<font face=garnet size=16 color=#00FF00><pens shadow=halfdark>Green color</pens></font>', End, FV_AddMember_Insert,o1]) F_DoA(win,FM_Notify,[FA_Window_CloseRequest,TRUE, app, FM_Application_Shutdown,0]) /* F_DoA(w,FM_Notify,[FA_Window_Active,TRUE, FV_Notify_Self, FM_Set,4,FA_Window_Title,t1,FA_NoNotify,TRUE]) F_DoA(w,FM_Notify,[FA_Window_Active,FALSE, FV_Notify_Self, FM_Set,4,FA_Window_Title,t2,FA_NoNotify,TRUE]) */ F_DoA(app,FM_Application_Run,NIL) F_DisposeObj(app) ELSE PrintF('Unable to create application\n') ENDIF CloseLibrary(feelinbase) ENDIF ENDPROC PROC hook_draw(msg=A1:PTR TO FS_ImageDisplay_HookDraw) DEF x1,y1,x2,y2,x3, rp:PTR TO rastport,pt,ap,bp sys_RGlob() pt := [%1111111100000000, %0111111110000000, %0011111111000000, %0001111111100000, %0000111111110000, %0000011111111000, %0000001111111100, %0000000111111110, %0000000011111111, %1000000001111111, %1100000000111111, %1110000000011111, %1111000000001111, %1111100000000111, %1111110000000011, %1111111000000001]:INT pt := [%1000100010001000, %0100010001000100, %0010001000100010, %0001000100010001]:INT /* %1000100010001000, %0100010001000100, %0010001000100010, %0001000100010001, %1000100010001000, %0100010001000100, %0010001000100010, %0001000100010001, %1000100010001000, %0100010001000100, %0010001000100010, %0001000100010001]:INT*/ /* pt := [%1111111100000000, %0111111110000000, %0011111111000000, %0001111111100000, %0000111111110000, %0000011111111000, %0000001111111100, %0000000111111110, %0000000011111111, %0000000111111110, %0000001111111100, %0000011111111000, %0000111111110000, %0001111111100000, %0011111111000000, %0111111110000000]:INT */ x1 := msg.region.x1 ; x3 := msg.region.x2 ; x2 := x3 - x1 / 3 + x1 y1 := msg.region.y1 ; y2 := msg.region.y2 ; rp := msg.render.rport ap := msg.render.palette.pens[FV_Pen_Fill] bp := msg.render.palette.pens[FV_Pen_HalfShadow] _APen(bp) _Boxf(x1,y1,x2,y2) rp.areaptrn := pt rp.areaptsz := 2 _APen(ap) _BPen(bp) _Boxf(x2+1,y1,x3,y2) rp.areaptsz := 0 rp.areaptrn := NIL ENDPROC